module.exports = class extends think.Logic {
  userstudyAction() {
    this.allowMethods = 'post'; //  只允许 POST 请求类型
    const rules = {
      name: {
        string: true,
        required: true,
        trim: true
      },
      phone: {
        mobile: 'zh-CN',
        required: true,
        trim: true
      },
      wechat: {
        string:true,
        required: true,
        trim: true
      },
      code:{
        string:true,
        required:true,
        trim:true
      }
    };
    const flag = this.validate(rules);
    if (!flag) {
      return this.fail('validate error', this.validateErrors);
    }
  }
};
